package com.vimi8.ebb.api.ebb;

import com.vimi8.ebb.configuration.HttpResponseEntity;
import com.vimi8.ebb.dto.*;
import com.vimi8.ebb.model.ElectricityBusiness;
import com.vimi8.ebb.model.Paginator;
import com.vimi8.ebb.model.ProductInfo;
import io.swagger.annotations.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by wangyang on 2017/1/18.
 */

@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringCodegen", date = "2016-09-19T10:01:46.405Z")

@Api(value = "ebb", description = "电商控制器")
@RestController
public interface ElectricityBusinessApi {

    @ApiOperation(value = "注册电商经营主体", notes = "注册电商经营主体.", response = String.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/ebb/",
            method = RequestMethod.POST)
    HttpResponseEntity<String> registerElectricityBusiness(HttpServletRequest request,
                                                           @ApiParam(value = "电商信息.", required = true) @RequestBody ElectricityBusiness electricityBusiness
    );

    @ApiOperation(value = "查询电商经营主体列表", notes = "查询电商经营主体列表.", response = ElectricityBusinessDto.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = ElectricityBusinessDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/ebb/list/",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<ElectricityBusinessDto>>> getElectricityBusinessList(
            @ApiParam(value = "页码", required = true) @RequestParam(value = "start", required = true) int start,
            @ApiParam(value = "数据大小", required = true) @RequestParam(value = "size", required = true) int size,
            @ApiParam(value = "电商类型", required = true) @RequestParam(value = "type", required = true) String type,
            @ApiParam(value = "地址码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
            @ApiParam(value = "开始时间", required = false) @RequestParam(value = "startTime", required = false) String startTime,
            @ApiParam(value = "结束时间", required = false) @RequestParam(value = "endTime", required = false) String endTime,
            @ApiParam(value = "电商名称", required = false) @RequestParam(value = "storeName", required = false) String storeName

    );


    @ApiOperation(value = "根据type查询电商经营主体总交易量，总交易额 ", notes = "根据type查询电商经营主体总交易量，总交易额", response = ElectricityBusinessDto.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = ElectricityBusinessDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/admin/ebb/TransactionTotalAmount/",
            method = RequestMethod.GET)
    HttpResponseEntity<HashMap<String,Object>> TransactionTotalAmount(
            @ApiParam(value = "电商类型", required = true) @RequestParam(value = "type", required = true) String type,
            @ApiParam(value = "地址码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
            @ApiParam(value = "是否可爬取(-1:无法爬取，0:待验证是否可爬取，1:可爬取)", required = false) @RequestParam(value = "pick", required = false) String pick,
            @ApiParam(value = "开始时间", required = false) @RequestParam(value = "startTime", required = false) String startTime,
            @ApiParam(value = "结束时间", required = false) @RequestParam(value = "endTime", required = false) String endTime,
            @ApiParam(value = "电商名称", required = false) @RequestParam(value = "storeName", required = false) String storeName

    );


    @ApiOperation(value = "根据type查询无法爬取数据的店铺量 ", notes = "根据type查询无法爬取数据的店铺量", response = Integer.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = Integer.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/admin/ebb/getUnPickAmountAdmin/",
            method = RequestMethod.GET)
    HttpResponseEntity<Integer> getUnPickAmountAdmin(
            @ApiParam(value = "电商类型", required = true) @RequestParam(value = "type", required = true) String type,
            @ApiParam(value = "地址码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
            @ApiParam(value = "开始时间", required = false) @RequestParam(value = "startTime", required = false) String startTime,
            @ApiParam(value = "结束时间", required = false) @RequestParam(value = "endTime", required = false) String endTime,
            @ApiParam(value = "电商名称", required = false) @RequestParam(value = "storeName", required = false) String storeName

    );


    @ApiOperation(value = "查询电商经营主体列表", notes = "查询电商经营主体列表.", response = ElectricityBusinessDto.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = ElectricityBusinessDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/admin/ebb/list/",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<ElectricityBusinessDto>>> getElectricityBusinessListAdmin(
            @ApiParam(value = "页码", required = true) @RequestParam(value = "start", required = true) int start,
            @ApiParam(value = "数据大小", required = true) @RequestParam(value = "size", required = true) int size,
            @ApiParam(value = "电商类型", required = true) @RequestParam(value = "type", required = true) String type,
            @ApiParam(value = "归属平台", required = false) @RequestParam(value = "platformCategory", required = false) String platformCategory,
            @ApiParam(value = "是否可爬取(-1:无法爬取，0:待验证是否可爬取，1:可爬取)", required = false) @RequestParam(value = "pick", required = false) String pick,
            @ApiParam(value = "地址码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
            @ApiParam(value = "开始时间", required = false) @RequestParam(value = "startTime", required = false) String startTime,
            @ApiParam(value = "结束时间", required = false) @RequestParam(value = "endTime", required = false) String endTime,
            @ApiParam(value = "电商名称", required = false) @RequestParam(value = "storeName", required = false) String storeName

    );


    @ApiOperation(value = "查询无区县电商经营主体列表", notes = "查询无区县电商经营主体列表.", response = ElectricityBusinessDto.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回对象", response = ElectricityBusinessDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/admin/ebb/noRegionList/",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<ElectricityBusinessDto>>> getElectricityBusinessNoRegionListAdmin(
            @ApiParam(value = "页码", required = true) @RequestParam(value = "start", required = true) int start,
            @ApiParam(value = "数据大小", required = true) @RequestParam(value = "size", required = true) int size,
            @ApiParam(value = "电商类型", required = true) @RequestParam(value = "type", required = true) String type,
            @ApiParam(value = "地址码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode
    );


    @ApiOperation(value = "查询电商经营主体列表(除服务站点)", notes = "查询电商经营主体列表(除服务站点).", response = ElectricityBusinessDto.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = ElectricityBusinessDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/ebb/exceptSit/",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<ElectricityBusinessDto>>> getElectricityBusinessListExceptSit(
            @ApiParam(value = "页码", required = true) @RequestParam(value = "start", required = true) int start,
            @ApiParam(value = "数据大小", required = true) @RequestParam(value = "size", required = true) int size,
            @ApiParam(value = "地址码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
            @ApiParam(value = "开始时间", required = false) @RequestParam(value = "startTime", required = false) String startTime,
            @ApiParam(value = "结束时间", required = false) @RequestParam(value = "endTime", required = false) String endTime,
            @ApiParam(value = "电商名称", required = false) @RequestParam(value = "storeName", required = false) String storeName

    );

    @ApiOperation(value = "查询电商经营主体列表", notes = "查询电商经营主体列表.", response = ElectricityBusinessDto.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = ElectricityBusinessDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/front/ebb/list/",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<ElectricityBusinessDto>>> getElectricityBusinessListFront(
            @ApiParam(value = "页码", required = true) @RequestParam(value = "start", required = true) int start,
            @ApiParam(value = "数据大小", required = true) @RequestParam(value = "size", required = true) int size,
            @ApiParam(value = "电商类型", required = true) @RequestParam(value = "type", required = true) String type,
            @ApiParam(value = "地址码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
            @ApiParam(value = "电商名称", required = false) @RequestParam(value = "storeName", required = false) String storeName

    );

    @ApiOperation(value = "查询单个电商经营主体", notes = "查询电商经营主体.", response = String.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/ebb/",
            method = RequestMethod.GET)
    HttpResponseEntity<ElectricityBusinessDto> getElectricityBusiness(
            @ApiParam(value = "id", required = true) @RequestParam(value = "id", required = true) String id
    );

    @ApiOperation(value = "修改单个电商经营主体", notes = "修改单个电商经营主体.", response = String.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/ebb/",
            method = RequestMethod.PUT)
    HttpResponseEntity<String> updateElectricityBusiness(
            @ApiParam(value = "修改单个电商经营主体", required = true) @RequestBody ElectricityBusinessDto electricityBusinessDto
    );

    @ApiOperation(value = "删除单个电商经营主体", notes = "删除单个电商经营主体.", response = String.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/ebb/",
            method = RequestMethod.DELETE)
    HttpResponseEntity<String> deleteElectricityBusiness(
            @ApiParam(value = "id", required = true) @RequestParam(value = "id", required = true) String id
    );


    @ApiOperation(value = "批量删除电商经营主体", notes = "批量删除电商经营主体.参数形如：'xxxx','xxxx','xxxx'", response = String.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/ebbDeleteSelectedAll/",
            method = RequestMethod.DELETE)
    HttpResponseEntity<String> deleteSelectedAllElectricityBusiness(
            @ApiParam(value = "ids", required = true) @RequestBody(required = true) String ids
    );



    @ApiOperation(value = "添加单个电商经营主体产品", notes = "添加单个电商经营主体产品.", response = String.class, tags={ "平台信息(后端)", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/ebb/product/",
            method = RequestMethod.POST)
    HttpResponseEntity<String> insertEbbProduct(
            @ApiParam(value = "添加经营主体产品", required = true) @RequestBody ProductInfo productInfo
    );

    @ApiOperation(value = "导入经营主体信息", notes = "导入经营主体信息.", response = String.class,
            tags = {"平台信息(后端)",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导入成功的提示信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/ebb/import",
            method = RequestMethod.POST)
    HttpResponseEntity<String> importLogistics(HttpServletRequest request, @RequestParam("file") MultipartFile file
    );

    @ApiOperation(value = "各区域经营情况汇总", notes = "各区域经营情况汇总.", response = RegionManamentDto.class,
            tags = {"数据分析",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导入成功的提示信息", response = RegionManamentDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = RegionManamentDto.class)})
    @RequestMapping(value = "/front/ebb/managementData/",
            method = RequestMethod.GET)
    HttpResponseEntity<HashMap<String,Object>> platformManagementData(
            @ApiParam(value = "时间", required = true) @RequestParam String time
    );

    @ApiOperation(value = "各区域销售额同比环比", notes = "各区域销售额同比环比.", response = RegionManamentDto.class,
            tags = {"数据分析",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导入成功的提示信息", response = RegionManamentDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = RegionManamentDto.class)})
    @RequestMapping(value = "/front/ebb/sales/",
            method = RequestMethod.GET)
    HttpResponseEntity<HashMap<String,Object>> platformSalesVolumeData(
            @ApiParam(value = "时间", required = true) @RequestParam String time
    );

    @ApiOperation(value = "数据管理首页最近十条数据", notes = "数据管理首页最近十条数据.", response = PlatformBusinessDto.class,
            tags = {"数据分析",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导入成功的提示信息", response = PlatformBusinessDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = PlatformBusinessDto.class)})
    @RequestMapping(value = "/front/ebb/news/data/",
            method = RequestMethod.GET)
    HttpResponseEntity<List<PlatformBusinessDto>> NewsDataGET(
    );

    @ApiOperation(value = "查询各地服务站点统计数", notes = "查询各地服务站点统计数.", response =RegionManamentDto.class,
            tags = {"数据分析",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导入成功的提示信息", response = RegionManamentDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = RegionManamentDto.class)})
    @RequestMapping(value = "/front/ebb/service/",
            method = RequestMethod.GET)
    HttpResponseEntity<List<RegionManamentDto>> RegisonServiceNumGET(
            @ApiParam(value = "地址码", required = true) @RequestParam String addressCode
    );

    @ApiOperation(value = "查询TOP10数据分析", notes = "查询TOP10数据分析.", response =RegionManamentDto.class,
            tags = {"数据分析",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导入成功的提示信息", response = RegionManamentDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = RegionManamentDto.class)})
    @RequestMapping(value = "/front/ebb/store/data/",
            method = RequestMethod.GET)
    HttpResponseEntity<List<RegionManamentDto>> StoreTopDataGET(
            @ApiParam(value = "地址", required = false) @RequestParam(required = false, value = "addressCode") String addressCode,
            @ApiParam(value = "开始时间", required = false) @RequestParam(required = false) String startTime
    );

    @ApiOperation(value = "查询店铺销量销售额", notes = "查询店铺销量销售额.", response =RegionManamentDto.class,
            tags = {"数据分析",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导入成功的提示信息", response = RegionManamentDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = RegionManamentDto.class)})
    @RequestMapping(value = "/front/ebb/store/sales/",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<RegionManamentDto>>> StoreSalesDataGET(
            @ApiParam(value = "id", required = true) @RequestParam(required = true) String id,
            @ApiParam(value = "开始页", required = true) @RequestParam(required = true) int start,
            @ApiParam(value = "页面大小", required = true) @RequestParam(required = true) int size
    );

    @ApiOperation(value = "查询数据统计概况", notes = "查询数据统计概况.", response =Map.class,
            tags = {"数据分析",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导入成功的提示信息", response = Map.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = Map.class)})
    @RequestMapping(value = "/front/ebb/data/survey/",
            method = RequestMethod.GET)
    HttpResponseEntity<HashMap<String,Object>> DataCountSurvey(
    );
    @ApiOperation(value = "查询各个区县的平台数", notes = "查询各个区县的平台数.", response =Map.class,
            tags = {"数据分析",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导入成功的提示信息", response = Map.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = Map.class)})
    @RequestMapping(value = "/front/platform/count/",
            method = RequestMethod.GET)
    HttpResponseEntity<HashMap<String,Object>> getPlatformNumGET(
    );

    @ApiOperation(value = "导出平台信息", notes = "导出平台信息.", response = String.class,
            tags = {"平台信息(后端)",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导出成功的提示信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/business/export/",
            method = RequestMethod.GET)
    void exportBusiness(@ApiParam(value = "平台类型", required = true) @RequestParam(value = "type", required = true) String type,
                        @ApiParam(value = "地址编码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
                        @ApiParam(value = "店铺名称", required = false) @RequestParam(value = "storeName", required = false) String storeName,
                        @ApiParam(value = "平台", required = false) @RequestParam(value = "platform", required = false) String platform,
                        @ApiParam(value = "时间", required = false) @RequestParam(value = "startTime", required = false) String startTime,
                        @ApiParam(value = "时间", required = false) @RequestParam(value = "endTime", required = false) String endTime,
                        HttpServletResponse response);

    @ApiOperation(value = "导出平台统计详细信息", notes = "导出平台统计详细信息.", response = String.class,
            tags = {"平台信息(后端)",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导出成功的提示信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/business/detail/export/",
            method = RequestMethod.GET)
    void exportBusinessDetail(
            @ApiParam(value = "类型", required = false) @RequestParam(value = "type", required = false) String type,
            @ApiParam(value = "开始时间", required = false) @RequestParam(value = "startTime", required = false) String startTime,
            @ApiParam(value = "结束时间", required = false) @RequestParam(value = "endTime", required = false) String endTime,
            HttpServletResponse response);

    @ApiOperation(value = "导出平台统计信息", notes = "导出平台统计信息.", response = String.class,
            tags = {"平台信息(后端)",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导出成功的提示信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/business/total/export/",
            method = RequestMethod.GET)
    void exportBusinessTotal1(
            @ApiParam(value = "类型", required = false) @RequestParam(value = "type", required = false) String type,
            @ApiParam(value = "开始时间", required = false) @RequestParam(value = "startTime", required = false) String startTime,
            @ApiParam(value = "结束时间", required = false) @RequestParam(value = "endTime", required = false) String endTime,
            HttpServletResponse response);

    @ApiOperation(value = "查询归属平台分类", notes = "查询归属平台分类.", response = String.class,
            tags = {"平台信息(后端)",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导出成功的提示信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/platform/category/",
            method = RequestMethod.GET)
    public HttpResponseEntity<List<String>> platformCategoryGET(@ApiParam(value = "平台类型", required = false) @RequestParam(value = "type", required = false) String type);

}
